<script setup>
import { ref } from 'vue';
import { useTodoStore } from '../store/todos';

const todos = useTodoStore()
const taskname = ref('')
const hAdd =()=>{
todos.add(taskname.value)
taskname.value = ''
}
</script>

<template>
  <header class="header">
    <h1>todos</h1>
    <input class="new-todo" placeholder="What needs to be done?" autofocus v-model='taskname' @keydown.enter="hAdd"/>
  </header>
</template>

<style lang="less" scoped></style>
